package net.kelissa.jenetic.impl.gene;

import net.kelissa.jenetic.Gene;
import net.kelissa.jenetic.RandomUtil;

public abstract class GeneBase implements Gene
{

  @Override
  public Gene conceive(Gene other)
  {
    double rand = RandomUtil.getRandom().nextDouble();
    if (rand < 0.5)
      return this.clone();
    else
      return other.clone();
  }

  @Override
  public int compareTo(Gene other)
  {
    return this.compareTo(other);
  }

  public abstract Gene clone();

}